/**
 * 判断对象是否存在相同的key
 * @param obj 
 * @returns  boolean
 */
export const hasDuplicateKeys = (obj: any) => {
    const keys = {};
    const duplicates = [];

    for (const key in obj) {
        if (key in keys) {
            duplicates.push(key);
        }
        keys[key] = true;
    }

    return duplicates.length > 0;
}
